<template>
	<view style="padding-top:100rpx;">
		<view class="text-area">
			<text>输入值：</text>
			<input type="text" v-model="title" style="color: red;" />
		</view>
		<view class="text-area">
			<text>回传值：</text>
			<input type="text" :value="callBackValue" style="color: yellow;" />
		</view>
		<comA :itent="title"></comA>
		<comB @callBackFunction="callBack"></comB>
	</view>
</template>

<script>
	//引用
	import comA from '../../../components/comA.vue';
	import comB from '../../../components/comB.vue';
	export default {
		//声明
		components:{
			comA,
			comB
		},
		data() {
			return {
				title:"",
			};
		},
		created(){
			console.log("comB created");
			uni.$on('sendIntent',(msg)=>{
				console.log("sendIntent---comB get Intent " + msg);
			})
		},
		methods: {
			callBack(msg){
				console.warn("----index----callBack-->" + msg);
				this.callBackValue = msg;
			}
		}
	}
</script>

<style>

</style>